/*******************************************************************************
 * 
 * Designed by : A. Augustine Joseph Starting Date : 11-01-2003 Last modified by :
 * A. Augustine Joseph Last modified Date : 17-01-2003 Total number of Class : 1
 * Total number of Methods : 6 Class Description : The class is used for
 * creating a sub class that use the Abstract Table model.
 *  
 ******************************************************************************/


package com.jjprojects.earutility;
import javax.swing.table.AbstractTableModel;

public class CustomAbstractTableModel extends AbstractTableModel
{
    int x = 0, y = 0;

    String cells[][];

    boolean option = false;

    int TableNo = 0;

    int clsid = 0;

    EARFilesComparingTool objEARFilesCompare = null;
    FilesComparingTool objFilesComparingTool = null;
    
    /***************************************************************************
     * 
     * Method Description : Constructor used for diffencating the calling class
     * and gettig some property from the calling class Method Parameter1 :
     * IndividualTeacherSchedule Method Parameter1 Value : Calling Class Method
     * Parameter2 : int Method Parameter2 Value : Number of rows in the table
     * Method Parameter3 : int Method Parameter3 Value : Number of columns in
     * the table Method Parameter4 : boolean Method Parameter4 Value : Weather
     * the table is editable or not Method Parameter5 : int Method Parameter5
     * Value : Calling class Id
     * 
     * Method Return Type : No Use of Return Value : No
     *  
     **************************************************************************/
    public CustomAbstractTableModel(EARFilesComparingTool i, int rows, int cols,
            boolean editable, int CalledBy)
    {
        objEARFilesCompare = i;
        option = editable;
        x = rows;
        y = cols;
        clsid = CalledBy;
        cells = new String[x][y];
    }
    
    public CustomAbstractTableModel(FilesComparingTool i, int rows, int cols,
            boolean editable, int CalledBy)
    {
        objFilesComparingTool = i;
        option = editable;
        x = rows;
        y = cols;
        clsid = CalledBy;
        cells = new String[x][y];
    }

    
    
    /***************************************************************************
     * 
     * Method Description : This method is set for setting weather the cell is
     * edited or not Method Parameter1 : int Method Parameter1 Value : Current
     * Row Method Parameter2 : int Method Parameter2 Value : Current Column
     * 
     * Method Return Type : boolean Use of Return Value : Weather the cell is
     * edited or not.
     *  
     **************************************************************************/
    public boolean isCellEditable(int row, int col)
    {
        return false;
    }

    /***************************************************************************
     * 
     * Method Description : This method is used for getting row count Method
     * Parameter : No Method Parameter Value : No
     * 
     * Method Return Type : int Use of Return Value : Total Number of Row.
     *  //
     **************************************************************************/
    public int getRowCount()
    {
        return x;
    }
    /***************************************************************************
     * 
     * Method Description : This method is used for getting column count Method
     * Parameter : No Method Parameter Value : No
     * 
     * Method Return Type : int Use of Return Value : Total Number of column.
     *  
     **************************************************************************/
    public int getColumnCount()
    {
        return y;
    }

    /***************************************************************************
     * 
     * Method Description : This method is used for getting the value at a
     * purticular cell Method Parameter1 : int Method Parameter1 Value : Current
     * Row Method Parameter2 : int Method Parameter2 Value : Current Column
     * 
     * Method Return Type : Object Use of Return Value : The condents of the
     * Cell
     *  
     **************************************************************************/
    public Object getValueAt(int r, int c)
    {
        return cells[r][c];
    }

    /***************************************************************************
     * 
     * Method Description : This method is set for setting weather the cell is
     * edited or not Method Parameter1 : Object Method Parameter1 Value : The
     * value to set in the Row Method Parameter2 : int Method Parameter2 Value :
     * Current Row Method Parameter3 : int Method Parameter3 Value : Current
     * Column
     * 
     * Method Return Type : Void Use of Return Value : No
     *  
     **************************************************************************/
    public void setValueAt(Object value, int row, int column)
    {
        cells[row][column] = (String) value;
        fireTableRowsUpdated(row, column);
    }

   
}